< previous page page_646 next page >

Page 646
In the Scroll event of the slider control, you can grab the current Value property from the slider and use that value to update the text box as the slider moves back and forth. Heres how:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub sldSalary_Scroll()
   txtSalary.Text = Format(sldSalary.Value, "Currency")
End Sub
The UpDown Control
The UpDown control is used to increment or decrement the value in another control to a new value (see Figure 31.5). You can use this control to increment any type of value you want. You can use it for numeric values, date values, and so on. When you use this control to change numeric values, no code is required. However, for any other type of value, you need to write a little bit of code.
Examples Filename: UpDown.frm
8160-0646a.gif
Figure 31.5
The UpDown control example.
Common Properties of the UpDown Control
Table 31.8 shows the most commonly set properties for the UpDown control.
Table 31.8 Common Properties of the UpDown Control.
PropertyDescription
AutoBuddySet this property to True in the Properties window if you want it to fill in the BuddyControl and BuddyProperty properties with the control that has its TabIndex property set to one less than this control. For example, if you have a text box next to the UpDown control, and the UpDown control has the value 10 in the TabIndex property, set the TabIndex property of the text box to the value 9. Then, set the AutoBuddy property to True to fill in the BuddyControl and BuddyProperty properties automatically.
BuddyControlThis identifies the name of the control thats the buddy to the UpDown control.

(table continued on next page)

 
< previous page page_646 next page >

If you like this book, buy it!